-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use new geolookup api #1158
base: main
Are you sure you want to change the base?
use new geolookup api #1158
Conversation
72db8bc
to
287ef45
Compare
@@ -94,6 +93,10 @@ func TestProxying(t *testing.T) { | |||
newResult, err := Start("testapp", "en_US", testSettings{}, testSession{}) | |||
require.NoError(t, err, "Should have been able to start lantern twice") | |||
require.Equal(t, result.HTTPAddr, newResult.HTTPAddr, "2nd start should have resulted in the same address") | |||
|
|||
// give the client time to initialize. This helps with consistency in tests | |||
time.Sleep(1 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something you can expose to synchronize on that will guarantee that it's initialized? Sleeping in tests is always a bad idea and the tests are already super flakey.
@@ -160,7 +163,7 @@ func testProxiedRequest(helper *integrationtest.Helper, proxyAddr string, dnsGra | |||
|
|||
var buf []byte | |||
|
|||
buf, err = ioutil.ReadAll(res.Body) | |||
buf, err = io.ReadAll(res.Body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a sanity check to the length of the body here? Just check Response.ContentLength or whatever it's called, or add a io.LimitReader to some reasonably (large) value? Although I do see a timeout above, if it applies to body reading then it's moot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It think it applies to the entire request, including reading the body.
The geolocation, user info, and proxy config requests in
flashlight
have been merged into a single request. The newflashlight/geolookup
now only stores the IP and country andRefresh
has been removed.This PR relies on flashlight PR and, as such, is using that branch. Once the flashlight PR is merged, this will need to be updated to use the main branch again before this can be merged.